<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<div class='form-group'>
				<label class='col-md-2 control-label'>orderNum</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='orderNum' type='text' name='orderNum' id='orderNum' data-bv-notempty='true' data-bv-notempty-message='orderNum 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>total</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='total' type='text' name='total' id='total' data-bv-notempty='true' data-bv-notempty-message='total 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>integral</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='integral' type='text' name='integral' id='integral' data-bv-notempty='true' data-bv-notempty-message='integral 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>payment</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='payment' type='text' name='payment' id='payment' data-bv-notempty='true' data-bv-notempty-message='payment 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>paymentType</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='paymentType' type='text' name='paymentType' id='paymentType' data-bv-notempty='true' data-bv-notempty-message='paymentType 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>postType</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='postType' type='text' name='postType' id='postType' data-bv-notempty='true' data-bv-notempty-message='postType 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>status</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='status' type='text' name='status' id='status' data-bv-notempty='true' data-bv-notempty-message='status 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>paymentTime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='paymentTime' type='text' name='paymentTime' id='paymentTime' data-bv-notempty='true' data-bv-notempty-message='paymentTime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>consignTime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='consignTime' type='text' name='consignTime' id='consignTime' data-bv-notempty='true' data-bv-notempty-message='consignTime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>endTime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='endTime' type='text' name='endTime' id='endTime' data-bv-notempty='true' data-bv-notempty-message='endTime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>closeTime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='closeTime' type='text' name='closeTime' id='closeTime' data-bv-notempty='true' data-bv-notempty-message='closeTime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>shippingName</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='shippingName' type='text' name='shippingName' id='shippingName' data-bv-notempty='true' data-bv-notempty-message='shippingName 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>shippingCode</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='shippingCode' type='text' name='shippingCode' id='shippingCode' data-bv-notempty='true' data-bv-notempty-message='shippingCode 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>freight</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='freight' type='text' name='freight' id='freight' data-bv-notempty='true' data-bv-notempty-message='freight 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>userId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='userId' type='text' name='userId' id='userId' data-bv-notempty='true' data-bv-notempty-message='userId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>receiverPhone</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='receiverPhone' type='text' name='receiverPhone' id='receiverPhone' data-bv-notempty='true' data-bv-notempty-message='receiverPhone 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>receiverName</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='receiverName' type='text' name='receiverName' id='receiverName' data-bv-notempty='true' data-bv-notempty-message='receiverName 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>receiverAreaName</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='receiverAreaName' type='text' name='receiverAreaName' id='receiverAreaName' data-bv-notempty='true' data-bv-notempty-message='receiverAreaName 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>afterSalesService</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='afterSalesService' type='text' name='afterSalesService' id='afterSalesService' data-bv-notempty='true' data-bv-notempty-message='afterSalesService 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>invoice</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='invoice' type='text' name='invoice' id='invoice' data-bv-notempty='true' data-bv-notempty-message='invoice 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>num</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='num' type='text' name='num' id='num' data-bv-notempty='true' data-bv-notempty-message='num 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>smallPic</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='smallPic' type='text' name='smallPic' id='smallPic' data-bv-notempty='true' data-bv-notempty-message='smallPic 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>type</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='type' type='text' name='type' id='type' data-bv-notempty='true' data-bv-notempty-message='type 不能为空'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='goodsOrderList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="add()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		function add() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'post',
				url : '/goodsOrders',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("添加成功", {shift: -1, time: 1000}, function(){
                        location.href = "goodsOrderList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
